﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Tsundere
{
    class Objeto3D
    {
        Model modelo;

        public Vector3 posicao;
        public Vector3 rotacao;
        public Vector3 escala;

        

        public Objeto3D(Model modelo)
        {
            this.modelo = modelo;

            posicao = new Vector3(0, 0, 0);
            rotacao = new Vector3(0, 0, 0);
            escala = new Vector3(1, 1, 1);
        }

        public void Update(GameTime gameTime)
        {
            //this.rotacao.Y += 1;
          
        }

        public Matrix worldMatrx
        {
            get
            {
                Matrix matriz = Matrix.Identity
                    * Matrix.CreateScale(escala)
                    * Matrix.CreateRotationX(MathHelper.ToRadians(rotacao.X))
                    * Matrix.CreateRotationY(MathHelper.ToRadians(rotacao.Y))
                    * Matrix.CreateRotationZ(MathHelper.ToRadians(rotacao.Z))
                    * Matrix.CreateTranslation(posicao);

               

                return matriz;
            }
        }
        

        

        public void Draw(Camera3D camera)
        {
            modelo.Draw(worldMatrx, camera.View, camera.projecao);
        }
    }
}
